//package com.example.export.config;
//
//import com.example.export.job.DcAppJob;
//import com.example.export.service.DcAppService;
//import org.quartz.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author dangwen1
// * @date 2022年01月20日 10:44
// * @description
// */
//@Configuration
//public class QuartzConfig {
//
//    @Autowired
//    private DcAppService dcAppService;
//
//    @Bean
//    public JobDetail jobDetail(){
//        return JobBuilder.newJob(DcAppJob.class).storeDurably().build();
//    }
//
//    @Bean
//    public Trigger myTrigger(){
//        Integer quartzTime = dcAppService.getQuartzTime() == null ? 3 : dcAppService.getQuartzTime();
//        System.out.println(quartzTime);
//        SimpleScheduleBuilder simpleScheduleBuilder = SimpleScheduleBuilder.simpleSchedule()
//                .withIntervalInSeconds(quartzTime).repeatForever();
//        return TriggerBuilder.newTrigger().forJob(jobDetail()).withSchedule(simpleScheduleBuilder).build();
//    }
//}
